/**
 * Created By zhangQ 2018/2/16
 * 百度地图导入
 */

export function MP (ak) {
  return new Promise(function (resolve, reject) {
    // <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=HYPTMfzFtQSrQzrSYd54Lv6OnOsCCexo"></script>
    if (BMap) {
      resolve(BMap)
    } else {
      setTimeout(() => {
        if (BMap) {
          resolve(BMap)
        } else {
          resolve(null)
        }
      }, 500)
    }
  })
}
